class GameStats:
    """跟踪游戏统计信息"""

    def __init__(self, ai_settings):
        """初始化统计信息"""
        self.ai_settings = ai_settings
        self.reset_stats()
        # 游戏活动状态
        self.game_active = False
        # 最高得分
        self.high_score = 0

    def reset_stats(self):
        """重置游戏"""
        self.ships_left = self.ai_settings.ship_limit
        # 得分
        self.score = 0
        # 等级
        self.level = 1

